{defun name="myList" list=$categories}
<ul>
{foreach from=$list item=node}
<li>
	{if $node.childs ne false}
		<a href="#" onclick="recurse('{$node.id}','category_{$node.id}','radio');show('category_{$node.id}');return false;">{$node.title}</a>
		<div id="category_{$node.id}" {if $node.inside_selected ne true}style="display:none;"{/if}>{fun name="myList" list=$node.sub}</div>
	{else}
		<input type="radio" name="item[pid]" value="{$node.id}" id="category_{$node.id}" {if $node.selected}checked{/if}> <label for="category_{$node.id}">{$node.title}</label>
	{/if}
</li>
{/foreach}
</ul>
{/defun}